import 'package:flutter/material.dart';
import 'package:window_example/page_navigation/catalogue_page.dart';
import 'package:window_example/util/print_util.dart';

import '../interface/content_page.dart';
import '../util/responsive.dart';
import 'drawer_items.dart';

class DrawerContent extends ContentPage {
  @override
  Widget getContent() {
    return const DrawerMain();
  }
}

class DrawerMain extends StatefulWidget {
  const DrawerMain({super.key});

  @override
  State<DrawerMain> createState() => _DrawerMainState();
}

class _DrawerMainState extends State<DrawerMain> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        drawer: const DrawLayout(),
        body: Row(
          children: [
            // if (Responsive.isDesktop(context))
            // const Expanded(
            //   flex: 1,
            //   child: DrawLayout(),
            // ),
            Expanded(
              flex: 3,
              child: Container(),
            )
          ],
        ),
      ),
    );
  }
}

class DrawLayout extends StatelessWidget {
  const DrawLayout({super.key});

  @override
  Widget build(BuildContext context) {
    return Drawer(
      child:  CataloguePage()
      // ListView(
      //   children: [
      //     const DrawerHeader(
      //       decoration: BoxDecoration(color: Colors.purple),
      //       child: Center(
      //         child: Text("dekun.tang"),
      //       ),
      //     ),
      //     ListTile(
      //       title: Text("Item1"),
      //       onTap: () {
      //         LoggerUtil.d("Item1 onClick");
      //         Navigator.of(context)
      //             .push(MaterialPageRoute(builder: (BuildContext context) {
      //           return const DrawItem1();
      //         }));
      //       },
      //     ),
      //     CataloguePage()
      //   ],
      // ),
    );
  }
}
